home *** CD-ROM | disk | FTP | other *** search
/ PC Elektro 3 / PC-Elektro-3-cd1.bin / KBan 2.0 / KBANSRC.LZH / SRC / PROG / DRAW.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-06-06  |  6.5 KB  |  142 lines

  1. /*
  2.  * a header of the class KBAN_DRAW
  3.  * Copyright (C) 1996, 1997 Kazutaka Hirata <khirata@jove.acs.unt.edu>
  4.  */
  5.  
  6. #ifndef _DRAW_H_
  7. #define _DRAW_H_
  8.  
  9. // stdafx.h should be included already.
  10.  
  11. #include "kbandata/kbandata.h"
  12.  
  13. #include "common/flag.h"
  14.  
  15. #include "drawinfo.h"
  16. #include "safedraw.h"
  17.  
  18. class KBAN_DRAW : private SAFE_DRAW {
  19.   const DRAW_INFO& m_grid;
  20.   FLAG             m_fill;
  21.   FLAG             m_hole;
  22.   const FLAG*      m_lflags;
  23.  
  24.   uint             m_main_grid_width;
  25.   uint             m_sub_grid_width;
  26.   XY               m_grid_origin;
  27.  
  28.   COLORREF         m_grid_color;
  29.  
  30.   class DRAW_ATTR {
  31.     COLORREF m_color;
  32.     bool     m_xor;
  33.   public:
  34.     void set(COLORREF color, bool xor) {
  35.       m_color = color;
  36.       m_xor   = xor  ;
  37.     }
  38.     COLORREF color(void) const { return m_color; }
  39.     bool     xor(void) const { return m_xor; }
  40.   };
  41.   DRAW_ATTR        m_layer_attr [LAYER_NUMBER];
  42.   DRAW_ATTR        m_cursor_attr[LAYER_NUMBER];
  43.   DRAW_ATTR        m_target_attr[LAYER_NUMBER];
  44.   DRAW_ATTR        m_erase_attr [LAYER_NUMBER];
  45. public:
  46.   KBAN_DRAW(
  47.     CDC* pDC,
  48.     const DRAW_INFO& grid,
  49.     const FLAG& fill,
  50.     const FLAG& hole,
  51.     const FLAG* lflags
  52.   );
  53. private:
  54.   void  draw_sub_grid(void);
  55.   void  draw_main_grid(void);
  56. public:
  57.   void  draw_grid(void);
  58. private:
  59.   void  draw_box_core(const XY& ac1, const XY& ac2, const DRAW_ATTR& attr);
  60.  
  61.   void  draw_primitive_pin_core     (const PIN_ELEMENT& target, const DRAW_ATTR& attr);
  62.   void  draw_primitive_pin_hole_core(const PIN_ELEMENT& target, const DRAW_ATTR& attr);
  63.  
  64.   void  draw_primitive_line_core(const LINE_ELEMENT& target, const DRAW_ATTR& attr);
  65.  
  66.   void  draw_primitive_pin_list_core     (const PIN_LIST& target, const DRAW_ATTR& attr);
  67.   void  draw_primitive_pin_list_hole_core(const PIN_LIST& target, const DRAW_ATTR& attr);
  68.  
  69.   void  draw_primitive_line_list_core(const LINE_LIST& target, const DRAW_ATTR& attr);
  70.  
  71.   void  draw_primitive_layer_core     (const LAYER& target, const DRAW_ATTR& attr);
  72.   void  draw_primitive_layer_hole_core(const LAYER& target, const DRAW_ATTR& attr);
  73.  
  74.   void  draw_primitive_core     (const PRIMITIVE& target, uint layer_no, const DRAW_ATTR& attr);
  75.   void  draw_primitive_hole_core(const PRIMITIVE& target, uint layer_no, const DRAW_ATTR& attr);
  76.  
  77.   void  draw_one_component_pin_list_core     (const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr);
  78.   void  draw_one_component_pin_list_hole_core(const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr);
  79.   void  draw_one_component_line_list_core    (const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr);
  80.   void  draw_one_component_layer_core        (const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr);
  81.   void  draw_one_component_layer_hole_core   (const COMPONENT_ELEMENT& target, uint layer, const DRAW_ATTR& attr);
  82.   void  draw_one_component_core              (const COMPONENT_ELEMENT& target, uint active_layer, const DRAW_ATTR attr_table[]);
  83.   void  draw_one_component_hole_core         (const COMPONENT_ELEMENT& target, uint active_layer, const DRAW_ATTR attr_table[]);
  84.  
  85.   void  draw_component_list_core     (const COMPONENT_LIST& target, uint layer_no, const DRAW_ATTR& attr);
  86.   void  draw_component_list_hole_core(const COMPONENT_LIST& target, uint layer_no, const DRAW_ATTR& attr);
  87.  
  88.   void  draw_kban_data_core     (const KBAN_DATA& target, uint active_layer, const DRAW_ATTR attr_table[]);
  89.   void  draw_kban_data_hole_core(const KBAN_DATA& target, uint active_layer, const DRAW_ATTR attr_table[]);
  90. public:
  91.   void  draw_box       (const XY& ac1, const XY& ac2);
  92.   void  draw_box_cursor(const XY& ac1, const XY& ac2);
  93.   void  erase_box      (const XY& ac1, const XY& ac2);
  94.  
  95.   void  draw_primitive_pin       (const PIN_ELEMENT& target, uint layer_no);
  96.   void  draw_primitive_pin_cursor(const PIN_ELEMENT& target               );
  97.   void  draw_primitive_pin_target(const PIN_ELEMENT& target               );
  98.   void  erase_primitive_pin      (const PIN_ELEMENT& target               );
  99.  
  100.   void  draw_primitive_line       (const LINE_ELEMENT& target, uint layer_no);
  101.   void  draw_primitive_line_cursor(const LINE_ELEMENT& target               );
  102.   void  draw_primitive_line_target(const LINE_ELEMENT& target               );
  103.   void  erase_primitive_line      (const LINE_ELEMENT& target               );
  104.  
  105.   void  draw_primitive_pin_list       (const PIN_LIST& target, uint layer_no);
  106.   void  draw_primitive_pin_list_cursor(const PIN_LIST& target               );
  107.   void  draw_primitive_pin_list_target(const PIN_LIST& target               );
  108.   void  erase_primitive_pin_list      (const PIN_LIST& target               );
  109.  
  110.   void  draw_primitive_line_list       (const LINE_LIST& target, uint layer_no);
  111.   void  draw_primitive_line_list_cursor(const LINE_LIST& target               );
  112.   void  draw_primitive_line_list_target(const LINE_LIST& target               );
  113.   void  erase_primitive_line_list      (const LINE_LIST& target               );
  114.  
  115.   void  draw_primitive_layer       (const LAYER& target, uint layer_no);
  116.   void  draw_primitive_layer_cursor(const LAYER& target               );
  117.   void  draw_primitive_layer_target(const LAYER& target               );
  118.   void  erase_primitive_layer      (const LAYER& target               );
  119.  
  120.   void  draw_primitive       (const PRIMITIVE& target, uint layer_no);
  121.   void  draw_primitive_cursor(const PRIMITIVE& target, uint layer_no);
  122.   void  draw_primitive_target(const PRIMITIVE& target, uint layer_no);
  123.   void  erase_primitive      (const PRIMITIVE& target, uint layer_no);
  124.  
  125.   void  draw_one_component       (const COMPONENT_ELEMENT& target, uint active_layer);
  126.   void  draw_one_component_cursor(const COMPONENT_ELEMENT& target, uint active_layer);
  127.   void  draw_one_component_target(const COMPONENT_ELEMENT& target, uint active_layer);
  128.   void  erase_one_component      (const COMPONENT_ELEMENT& target, uint active_layer);
  129.  
  130.   void  draw_component_list       (const COMPONENT_LIST& target, uint layer_no);
  131.   void  draw_component_list_cursor(const COMPONENT_LIST& target, uint layer_no);
  132.   void  draw_component_list_target(const COMPONENT_LIST& target, uint layer_no);
  133.   void  erase_component_list      (const COMPONENT_LIST& target, uint layer_no);
  134.  
  135.   void  draw_kban_data       (const KBAN_DATA& target, uint active_layer);
  136.   void  draw_kban_data_cursor(const KBAN_DATA& target, uint active_layer);
  137.   void  draw_kban_data_target(const KBAN_DATA& target, uint active_layer);
  138.   void  erase_kban_data      (const KBAN_DATA& target, uint active_layer);
  139. };
  140.  
  141. #endif /* _DRAW_H_ */
  142.